package nyc3d;

import com.jme3.math.Vector3f;
import com.jme3.renderer.Camera;
import javax.swing.JOptionPane;


public class NYC3DHelper {
    public static void moveCamera(Camera camera){
        String loc = JOptionPane.showInputDialog(null, "Enter XYZ location (format: X, Y, Z):", "Enter Location", JOptionPane.QUESTION_MESSAGE);
        String locSpaces = loc.replace(",", "");
        int xEnd, yEnd;
        xEnd = locSpaces.indexOf(" ");
        yEnd = locSpaces.substring(xEnd+1).indexOf(" ");
        camera.setLocation(new Vector3f(Float.valueOf(locSpaces.substring(0, xEnd)), Float.valueOf(locSpaces.substring(xEnd+1).substring(yEnd)), Float.valueOf(locSpaces.substring(xEnd+1).substring(yEnd+1))));
    }
}
